/************************************************************************/
/*    Author: Scott Bevin                                               */
/************************************************************************/

#pragma once

/**
This class is an abstract class that acts as the interface for timers, for a timer to be usable it must implement
the update function.
@author Scott Bevin
@version 1.0
*/

namespace XF
{
	class Timer
	{
	protected:
		/**
		The elapsed time since last frame
		*/
		double m_deltaTime;
			/**
		The time stamp of the last frame
		*/
		double m_lastFrameIndex;
			/**
		The time stamp of the most current call to update()
		*/
		double m_thisFrameIndex;

	public:
				/**
		Constructor simply initializes variables
		*/
		Timer()
		{
			m_deltaTime = m_lastFrameIndex 
				= m_thisFrameIndex = 0;
		}

				/**
		blank virtual destructor to allow polymorphism to work correctly
		*/
		virtual ~Timer(){}

				/**
		update() must be implemented by child classes and will be used to update the variables in an API
		specific way
		*/
		virtual void update() = 0;

				/**
		returns the elapsed time since last frame
		*/
		double getDeltaTime(){return m_deltaTime;}
	};
}